import React,{useEffect,useState,createContext} from 'react'
import {getlist} from '../api/data'
import ChildOne  from './childOne'
export const setCreateContext=createContext(null)
export default function App() {
    const [list,setList]=useState([])
    useEffect(()=>{
        getlist().then(res=>{
            if(res){
                setList(res)
            }

        })
    },[])
    return (
        <div>
            <setCreateContext.Provider value={list}>
                  <ChildOne/>
            </setCreateContext.Provider>
            {/* {
                list.map((item,index)=>{
                    return item
                })
            } */}
          
        </div>
    )
}
